import {type CustomRequestConfig, MockConfig, MockMode,} from "./http-client-type.js";

// 自定义请求配置默认值对象
export const defaultCustomRequestConfig: CustomRequestConfig = {
  showLoading: false,
  showLoadingFunction() {},
  hideLoadingFunction() {},

  beforeHandleRequestHeaders() {},
  handleRequestHeaders() {},
  afterHandleRequestHeaders() {},

  serverResponseSuccess: true,
  passCompleteResponse: false,
  handleAuthenticationFailure() {},
  authenticationFailure: false,

  successMsg(serverResponse) {
    return serverResponse.msg;
  },
  showSuccessMsg: false,
  showSuccessMsgFunction() {},

  failureMsg(serverResponse) {
    return serverResponse.msg;
  },
  showFailureMsg: true,
  showFailureMsgFunction() {},
};

// 自定义请求Mock配置默认值对象
export const defaultMockConfig: Required<MockConfig> = {
  mode: MockMode.SERVER,
  mixModeDefaultMocked: false,
  defaultMockServerBaseUrl: null,
  defaultMockTemplate: null,
};
